
#include "atomic_op_asm.h"

	.text

#ifdef _KERNEL

/*
 * We start out with no-op versions that do nothing.  We hot-patch when
 * we detect a MP system.
 */
LEAF(_membar_producer, 0)
	RET
	nop
	END(_membar_producer)
EXPORT(_membar_producer_end)

LEAF(_membar_sync, 0)
	RET
	nop
	END(_membar_sync)
EXPORT(_membar_sync_end)

LEAF(_membar_producer_mp, 0)
	wmb
	RET
	END(_membar_producer_mp)
EXPORT(_membar_producer_mp_end)

LEAF(_membar_sync_mp, 0)
	mb
	RET
	END(_membar_sync_mp)
EXPORT(_membar_sync_mp_end)

#else	/* _KERNEL */

LEAF(_membar_producer, 0)
	mb
	RET
	END(_membar_producer)
EXPORT(_membar_producer_end)

LEAF(_membar_sync, 0)
	mb
	RET
	END(_membar_sync)
EXPORT(_membar_sync_end)

#endif	/* _KERNEL */

ATOMIC_OP_ALIAS(membar_producer,_membar_producer)
ATOMIC_OP_ALIAS(membar_sync,_membar_sync)
ATOMIC_OP_ALIAS(membar_enter,_membar_sync)
STRONG_ALIAS(_membar_enter,_membar_sync)
ATOMIC_OP_ALIAS(membar_exit,_membar_sync)
STRONG_ALIAS(_membar_exit,_membar_sync)
ATOMIC_OP_ALIAS(membar_consumer,_membar_sync)
STRONG_ALIAS(_membar_consumer,_membar_sync)
ATOMIC_OP_ALIAS(membar_datadep_consumer,_membar_sync)
STRONG_ALIAS(_membar_datadep_consumer,_membar_sync)
